<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="陈嘉乐">
    <title></title>
    <style>
        * {
            box-sizing: border-box;
        }

        .container {
            width: 1000px;
            
            margin: 0 auto;
        }
       
        ul li{
            border: 1px solid black;
            width: 150px;
            height: 100px;
            display: inline-block;
            margin: 10px;
        }
        ul h1{
            margin-left: 300px;
          
        }
        ul li h2{
            font-size: 10px;
           text-align: center;
        }
        ul li p{
         text-align: center;
        }
    </style>
</head>

<body>
    <div class="container">
        <ul >
            <h1>名车车标展示</h1>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
            <li>
                <h2>BMW</h2>
                <P>宝马汽车</P>
            </li>
        </ul>
    </div>
</body>

</html>
<script>
var lis = document.querySelectorAll('.container li');
 
 var imgs = [src="1.jpg" , src="2.jpg" , src="3.jpg" , src="4.jpg" , src="5.jpg" , src="6.jpg" , src="7.jpg" ,src= "8.jpg" , src="9.jpg" , src="10.jpg" ] ;
lis.onmousover = function () {
    imgs[i].index = i;
    for (var i = 0; i < imgs.length; i++) {
        imgs[i].index=lis;
        
    }
}


</script>